/****** Object:  Stored Procedure [dbo].spChiTietBienBanNhapHangGetList Script Date: 7/16/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spChiTietBienBanNhapHangGetList]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spChiTietBienBanNhapHangGetList]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		17/07/2012	SongTM					Innit created
*******************************************************************************/

CREATE PROCEDURE [dbo].[spChiTietBienBanNhapHangGetList]

WITH ENCRYPTION
AS

SELECT 
	[tbl_ChiTietBienBanNhapHang].*,
	[tbl_ChiTietPhieuNhap].MaCTPN,
	[tbl_ChiTietPhieuNhap].SoPN,
	[tbl_ChiTietPhieuNhap].SoLuong,
	[tbl_ChiTietPhieuNhap].DonGia,
	tbl_LuuKho.*
FROM 
	[tbl_ChiTietBienBanNhapHang] INNER JOIN tbl_ChiTietPhieuNhap on tbl_ChiTietPhieuNhap.MaCTPN = tbl_ChiTietBienBanNhapHang.MaCTPN
	INNER JOIN tbl_LuuKho ON tbl_LuuKho.MaLuuKho=tbl_ChiTietPhieuNhap.MaLuuKho

GO

--GRANT EXECUTE ON [dbo].[spChiTietBienBanNhapHangGetList] TO [sa]
--GO
